# SleepMirror - A reflection of your sleep quality
# 
# main_stub.rb
# TODO: Add description.
# 
# 
# ©2010 JohnGary, LLC.  All Rights Reserved.
# 
# 
# Changelog:
# 
# 
# 


=begin
require 'sm_test'

t=SM_panel.new("EQ135","\nTake two asprin and call in the morning.\n","./images/Eq135.png")
puts "test t with id=#{t.uid} name=#{t.name} instr=#{t.instructions} asset=#{t.asset}"
begin
t.perform
rescue NotImplementedError => e
  puts "The base class SM_test does not have a default implementation for method 'perform.'"
ensure
  puts "But remember to do this!"
end
=end
main_dir = File.dirname(__FILE__)  #get the directory we're in
Dir.chdir main_dir  # force the working directory to be where the script resides.  This is for Ocra expansion.
#SDL_PATHS = [ File.join( main_dir ) ] #Set the main_dir to the one we seach for SDL

require 'sm_menu'
#require 'sm_eq135'
#require 'sm_edge_detect'
#require 'sm_visual_truefalse'
require 'sm_humphrey_blue'
require 'sm_identify'

puts "Git 'r done"

#main_menu = SM_menu.new("SleepMirror - Main Menu","My instructions","SleepMirrorOpeningScreen.png")
#
main_menu = SM_menu.new("ChemOptic - Main Menu","My instructions","ChemOpticOpeningScreen.png")

until main_menu.answer == "end"
  begin
    main_menu.perform
  rescue SystemExit
    puts "Main Menu exiting with answer= #{main_menu.answer}"
  end

  if main_menu.answer == "start"
    a_battery=Array.new
#TODO: change these .news to SM_eq135.new, and SM_bars.new, and SM_splat.new
    #a_battery << SM_eq135.new("A visual test","Some instructions","Eq135.png")
    #a_battery << SM_edge_detect.new("A visual test","Some instructions","Blue2Black.jpg")

    #a_battery << SM_humphrey_blue.new("Humphrey Blues","Some instructions","Humphrey_blue_bg.jpg")
    a_battery << SM_identify.new("Please identify yourself")
    
    a_battery.each do |test|
      begin
        test.perform
      rescue SystemExit
        puts "Next!"
      end
    end

  end
end
puts "All done"
